package com.hamster.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hamster.crm.pojo.dto.CourseTime;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Tarry
 * @create 2019/12/27 16:25
 */
@Repository
@Mapper
public interface CourseTimeMapper extends BaseMapper<CourseTime> {

    /**
     * 根据courseId删除 课时
     * @param id
     */
    @Delete("delete from project_course_time where course_id=#{id}")
    void deleteCourseTimeByCourseId(String id);

    /**
     * 根据课程id，查询 课时
     * @param id
     * @return
     */
    @Select("select * from project_course_time where course_id=#{id}")
    List<CourseTime> queryListByCourseId(String id);
}
